{% extends "base.html" %}
{% block head %}
<head>
    <meta charset="UTF-8">
    <title>测试管理系统</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
    <link rel="stylesheet" href="../../../static/layui/css/layui.css">
    <script src="../../../static/layui/layui.js"></script>
    <!--     <script type="text/javascript">try { Typekit.load(); } catch (e) { }</script> -->
    <script type="text/javascript" src="../../../static/js/tool_p.js"></script>
</head>
{% endblock head %}
{% block left %}
{{ super() }}
{% endblock left %}
{% block right %}
{{ super() }}
<!-- 修改name（页面名称） -->
{% set name = "任务管理" %}
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>{{name}}</legend>
</fieldset>
<!-- 页面私有部分 -->
<div class="layui-form">
    <span class="layui-btn layui-btn-normal" name="task_add"
          onclick="task_add(this)">新增任务</span>
    <table class="layui-table" style="width: 85% ">
        <colgroup>
            <col width="40">
            <col width="80">
            <col width="40">
            <col width="40" style="display:none">
            <col width="50">
            <col width="50">
            <col width="50">
            <col width="50">
            <col width="120">
        </colgroup>
        <thead>
        <tr>
            <th>
                <div align="center">任务id</div>
            </th>
            <th>
                <div align="center">任务名称</div>
            </th>
            <th>
                <div align="center">频率</div>
            </th>
            <th style="display:none">
                <div align="center">状态</div>
            </th>
            <th>
                <div align="center">开始报警次数</div>
            </th>
            <th>
                <div align="center">停止报警次数</div>
            </th>
            <th>
                <div align="center">恢复报警次数</div>
            </th>
            <th>
                <div align="center">是否报警</div>
            </th>
            <th>
                <div style="text-align: center">操作</div>
            </th>
        </tr>
        </thead>
        <tbody>
        {% for i in task_list %}
        <tr>
            <td>
                <div align="center">{{i[0]}}</div>
            </td>
            <td>
                <div align="center">{{i[1]}}</div>
            </td>
            <td style="text-align:center;width:10px;">{{i[3]}}分钟/次</td>
            <td style="text-align:center;word-break:break-all;display:none">
                <div>{{i[4]}}</div>
            </td>
            <td>
                <div align="center">{{i[5]}}</div>
            </td>
            <td>
                <div align="center">{{i[8]}}</div>
            </td>
            <td>
                <div align="center">{{i[9]}}</div>
            </td>
            <td>
            {% if i[10] == 1 %}
                <div align="center">关</div>
            {% else %}
                <div align="center">开</div>
            {% endif %}
            </td>
            <td id="td1">

                {% if i[4] == 1 %}
                <span class="layui-btn layui-btn-normal" id="stoptask" name="status"
                      onclick="task_status(this)">停用</span>
                {% else %}
                <span class="layui-btn layui-btn-warm" id="starttask" name="status"
                      onclick="task_status(this)">启用</span>
                {% endif %}
                <span class="layui-btn" id="edittask" name="status1"
                      onclick="task_edit(this)">编辑</span>
                <span class="layui-btn layui-btn-normal" name="status1"
                      onclick="task_res(this)">查看结果</span>
                <span class="layui-btn layui-btn-danger" name="status1"
                      onclick="task_del(this)">删除</span>
            </td>
        </tr>
        {% endfor %}
        </tbody>
    </table>
</div>


{% endblock right %}
<!-- 此模板现有部分，除页面名称外，其他均不可编辑 -->